package com.factorymode.factory;

import com.factorymode.entity.Phone;

public class DefaultPhoneFactory extends AbstractPhoneFactory {

    @Override
   public Phone getPhone(String phoneName) {
        if("huawei".equals(phoneName)){
            return new HuaweiFactory().getPhone();
        }else if("iPhone".equals(phoneName)){
            return new IPhoneFactory().getPhone();
        }else if("xiaomi".equals(phoneName)){
            return new XiaomiFactory().getPhone();
        }else {
            return null;
        }
    }
}
